using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;

namespace Microsoft.Practices.Repository.Configuration.Design
{
    internal class AddRepositoryFactorySectionCommand : AddChildNodeCommand
    {
        public AddRepositoryFactorySectionCommand(IServiceProvider serviceProvider) 
            : base(serviceProvider, typeof(RepositoryFactorySectionNode))
        {
        }


        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);
            if(ChildNode != null)
            {
                ChildNode.AddNode(new RepositoryCollectionNode());
            }
        }
    }
}